package com.androspell.comicviewer.viewer;

import java.io.File;
import java.net.URI;

import android.app.Activity;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageSwitcher;
import android.widget.ImageView;

import com.androspell.comicviewer.R;
import com.androspell.comicviewer.browser.ComicBean;
import com.androspell.comicviewer.extractor.ExtractPreference;
import com.androspell.comicviewer.extractor.ExtractionManger;

/**
 * 
 * @author swaroop @AndroSpell
 *
 * Date : 09-Oct-2011
 */
public class ComicViewerActivity extends Activity{

	ImageView imageSwitcher;
	File[] files;
	int count = 0;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.standalone_example);
		
//		 	System.out.println("syso by varun :P");
//	        System.out.println("Test 2 commit");
//	        ComicBean comicBean = new ComicBean();
//	        comicBean.setBookTitle("naruto");
//	        comicBean.setBookUrl("/sdcard/naruto.cbz");
//	        ExtractionManger extractionManger = new ExtractionManger(getApplicationContext());
//	        extractionManger.startExtracting(comicBean);
//		
//		imageSwitcher = (ImageView)findViewById(R.id.page);
//		
//		files = (new File(ExtractPreference.extractToLocation+"naruto/")).listFiles();
//		System.out.println("file count" + files.length);
//		System.out.println("file path" + files[count].getAbsolutePath());
//		
//		imageSwitcher.setImageDrawable(BitmapDrawable.createFromPath(files[count].getAbsolutePath()));
//		imageSwitcher.setOnClickListener(new OnClickListener() {
//			
//			@Override
//			public void onClick(View v) {
//				count++;
//				System.out.println("count = "+ count);
//				imageSwitcher.setImageDrawable(BitmapDrawable.createFromPath(files[count].getAbsolutePath()));
//				
//			}
//		});
		
	}
}
